#include<map>
#include<set>
#include<cmath>
#include<queue>
#include<bitset>
#include<vector>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<iostream>
#include<algorithm>
#define rep(i,a,b) for(register int i = (a);i <= (b);++i)
#define per(i,a,b) for(register int i = (a);i >= (b);--i) 
#define mkp std::make_pair
typedef long long ll;
typedef unsigned long long ull;
using std::string;using std::cin;using std::cout;
inline bool cmp(int x,int y){return x < y;}

const int N = 1e6+9;
const int inf = 1e9+9;
const double eps = 1e-7;
int _,n,m,a[4][2*N];


int main(){
    std::ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    #ifdef LOCAL //use "g++ xxx.cpp -DLOCAL"
        freopen("in.in", "r", stdin);
    #endif
    cin >> _;
    while(_--){
        int last = -1;
        cin >> n;
        rep(i,1,n) cin >> a[1][i];
        rep(i,1,n) cin >> a[2][i];
        rep(i,1,n) cin >> a[3][i];
        rep(i,1,n-1){
            if(last != a[1][i]){
                last = a[1][i];
                cout << last << " ";
            } else {
                if(last != a[2][i]){
                    last = a[2][i];
                    cout << last << " ";
                } else {
                    last = a[3][i];
                    cout << last << " ";
                }
            }
        }
        rep(i,1,3){
            if(a[i][n] != a[1][1] && a[i][n] != last){cout << a[i][n] << "\n";break;}
        }
    }

    return 0;
}